import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import AboutView from '../views/AboutView.vue'
import SingList from '../components/songlist/SongList.vue'
import SingerHome from '../components/singer/SingerHome.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component:AboutView
  },
  {
    path: '/singlist/:id',//路由的动态参数
    name: 'singlist',
    component: SingList
  },
  {
    path: '/singerhome/:id',//路由的动态参数
    name: 'singerhome',
    component: SingerHome
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
